<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%@ taglib prefix="rapid" uri="http://www.rapid-framework.org.cn/rapid" %>


<rapid:override name="breadcrumb">
    <nav class="breadcrumb">
        <div class="bull"><i class="fa fa-volume-up"></i></div>
        <div id="scrolldiv">
            <div class="scrolltext">
                <ul style="margin-top: 0px;">
                    <c:forEach items="${noticeList}" var="n">
                        <li class="scrolltext-title">
                            <a href="/post/${n.postId}" rel="bookmark">${n.title}</a>
                        </li>
                    </c:forEach>
                </ul>
            </div>
        </div>
    </nav>
</rapid:override>

<rapid:override name="left">
    <div id="primary" class="content-area">

        <main id="main" class="site-main" role="main">
            <c:forEach items="${pageInfo.list}" var="p">

                <article class="post type-post">
                        <header class="entry-header">
                            <h2 class="entry-title">
                                <a href="/post/${p.postId}"
                                   rel="bookmark">
                                        ${p.title}
                                </a>
                            </h2>
                        </header>

                        <div class="entry-content">
                            <div class="archive-content" style="margin-bottom:50px">
                                ${p.postSummary}
                            </div>
                            <span class="title-l"></span>
                            <span class="new-icon">
                                        <jsp:useBean id="nowDate" class="java.util.Date"/>
                                        <c:set var="interval"
                                               value="${nowDate.time - p.updateTime.time}"/><%--时间差毫秒数--%>
                                        <fmt:formatNumber value="${interval/1000/60/60/24}" pattern="#0"
                                                          var="days"/>
                                        <c:if test="${days <= 7}">NEW</c:if>
                            </span>
                            <span class="entry-meta">
                                <span class="date">
                                    <fmt:formatDate value="${p.updateTime}" pattern="yyyy年MM月dd日"/>
                                &nbsp;&nbsp;
                                </span>
                                <span class="comment">&nbsp;&nbsp;
                                    <div style="display: inline-block;">
                                      <i class="fa fa-comment-o"></i>
                                        <c:choose>
                                            <c:when test="${p.commentCount<1}">
                                                发表评论
                                            </c:when>
                                            <c:otherwise>
                                                ${p.commentCount}
                                            </c:otherwise>
                                        </c:choose>
                                    </div>
                                </span>
                            </span>
                            <div class="clear"></div>
                        </div><!-- .entry-content -->
                    </article>
            </c:forEach>
        </main>
        <%@ include file="Public/part/paging.jsp" %>

    </div>
</rapid:override>
<%--左侧区域 end--%>

<%--侧边栏 start--%>
<rapid:override name="right">
    <%@include file="Public/part/sidebar-2.jsp" %>
</rapid:override>
<%--侧边栏 end--%>


<%@ include file="Public/framework.jsp" %>